package com.gton.lpl.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.Set;

/**
 * @program: PersonalDesign
 * @description: 项目一启动就执行
 **/
@Slf4j
@Component
@Order(value = 1)
public class MyApplicationRunner implements ApplicationRunner {

    @Override
    public void run(ApplicationArguments args) throws Exception {
        Set<String> optionNames = args.getOptionNames();
        for (String optionName : optionNames) {
            if ("mpw.key".equals(optionName)) {
                //如果启用了加密数据库信息
                log.info("数据库加密启动");
            }
        }
    }
}
